﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _5.IncreasingSeq
{
    class IncreasingSeq
    {
        static void Main(string[] args)
        {
            int[] numbers ={ 5, 2, 3, 4, 5, 3, 7, 8, 9, 2, 1, 2, 4, 4, 5, 6, 5, 6, 6, 6 };
            int bestlen = 1;
            int len = 0;
            for (int i = 0; i < numbers.Length - 1; i++)
            {

                Console.WriteLine("{0} + 1 == {1} ? - {2}", numbers[i], numbers[i + 1], numbers[i] + 1 == numbers[i + 1]);
                if ((numbers[i] + 1) == numbers[i + 1])
                {
                    if (bestlen <= len)
                    {
                        bestlen += 1;

                    }
                    len++;
                }
                else
                {
                    len = 1;
                }
            }
            Console.WriteLine("Bestlength=" + bestlen);
        }
    }
}

